﻿namespace pluginService
{
    public abstract class PluginBaseHandle : IPluginRecvice<IPluginData>
    {
        public virtual bool Open { get; set; } = false;

        public abstract string Name { get; }
        public PluginBaseHandle Next { get; set; }

        public virtual string OnRecvice(IPluginData t)
        {
            if(Open)
            {
                Handle(t);
            }
            if (Next != null)
            {
                return Next.OnRecvice(t);
            }
            return t.Message;
        }
        protected abstract void Handle(IPluginData t);
    }

}
